//
//  LocationViewController.m
//  BigToBig
//
//  Created by yi liu on 16/7/26.
//  Copyright © 2016年 cn.cloudtp. All rights reserved.
//

#import "LocationViewController.h"
#import "LocationButtonView.h"
#import "LocationQuickMatingController.h"
#import "LivingController.h"
#import "LocationIncubationController.h"
#import "InfoServiceController.h"
#import "ShenqingRZViewController.h"


@interface LocationViewController ()
<
    LocationButtonViewDelegate
>

@property (nonatomic , strong)LocationButtonView *quickMatingView;
@property (nonatomic , strong)LocationButtonView *livingView;
@property (nonatomic , strong)LocationButtonView *incubationView;
@property (nonatomic , strong)LocationButtonView *serviceView;

@end

@implementation LocationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.view.backgroundColor = COLOR_RGBA(241, 241, 241, 1);
    self.navigationController.navigationBar.barTintColor = COLOR_RGBA(77, 155, 255, 1);
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 64)];
    titleLabel.text = @"地利";
    [titleLabel setFont:[UIFont systemFontOfSize:20]];
    titleLabel.textAlignment = 1;
    titleLabel.textColor = [UIColor whiteColor];
    titleLabel.backgroundColor = [UIColor clearColor];
    [self.navigationItem setTitleView:titleLabel];

    
    self.navigationController.navigationBar.translucent = NO;
    
    self.navigationController.navigationBar.barTintColor = COLOR_RGBA(77, 155, 255, 1);
    
    [self createViews];
    
    
}

- (void)createViews{
    self.quickMatingView = [LocationButtonView createButtonViewWithFrame:CGRectMake(40, kScreenHeight / 4, (kScreenWidth - 90) / 2, kScreenHeight / 7) Title:@"速配大厅" ImageName:@"tx"];
    _quickMatingView.backgroundColor = [UIColor whiteColor];
    _quickMatingView.locationDelegate = self;
    [self.view addSubview:_quickMatingView];
    
    self.livingView = [LocationButtonView createButtonViewWithFrame:CGRectMake(self.quickMatingView.maxX + 10, self.quickMatingView.y, self.quickMatingView.width, self.quickMatingView.height) Title:@"直播大厅" ImageName:@"tx"];
    _livingView.backgroundColor = [UIColor whiteColor];
    _livingView.locationDelegate = self;
    [self.view addSubview:_livingView];
    
    self.incubationView = [LocationButtonView createButtonViewWithFrame:CGRectMake(self.quickMatingView.x, self.quickMatingView.maxY + 10, self.quickMatingView.width, self.quickMatingView.height) Title:@"孵化空间" ImageName:@"tx"];
    _incubationView.backgroundColor = [UIColor whiteColor];
    _incubationView.locationDelegate = self;
    [self.view addSubview:_incubationView];
    
    self.serviceView = [LocationButtonView createButtonViewWithFrame:CGRectMake(self.quickMatingView.maxX + 10, self.quickMatingView.maxY + 10, self.quickMatingView.width, self.quickMatingView.height) Title:@"信息服务" ImageName:@"tx"];
    _serviceView.backgroundColor = [UIColor whiteColor];
    _serviceView.locationDelegate = self;
    [self.view addSubview:_serviceView];
    
    
}



#pragma mark LocationView  PUSH  代理方法实现

- (void)pushToDetailViewControllerWithTitle:(NSString *)titleString{
    if ([titleString isEqualToString:@"速配大厅"]) {
        LocationQuickMatingController *locationQuickMatingVC = [[LocationQuickMatingController alloc]init];
        locationQuickMatingVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:locationQuickMatingVC animated:YES];
        
    }
    if ([titleString isEqualToString:@"直播大厅"]) {
        LivingController *livingController = [[LivingController alloc]init];
        [self.navigationController pushViewController:livingController animated:YES];
    }
    if ([titleString isEqualToString:@"孵化空间"]) {
        LocationIncubationController *locationIncubationController = [[LocationIncubationController alloc]init];
        locationIncubationController.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:locationIncubationController animated:YES];
    }
    if ([titleString isEqualToString:@"信息服务"]) {
        InfoServiceController *infoVC = [[InfoServiceController alloc] init];
        infoVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:infoVC animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
